﻿using UnityEngine;
using System.Collections;

public class marbleScript : MonoBehaviour {
    public float movementSpeed = 20.0f;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	
	void Update () {
//    	float verticalSpeed = Input.GetAxis ("Vertical") * movementSpeed;
    	float verticalSpeed = Input.GetAxis ("Vertical") * movementSpeed+0.5f;
		Vector3 perp=Vector3.Cross(Camera.main.transform.forward,Camera.main.transform.up);
//	    var horizontalSpeed:float = (Input.GetAxis ("Horizontal") * speed)*-1;
		rigidbody.AddForce(Camera.main.transform.forward*verticalSpeed);
		rigidbody.AddForce(perp.normalized*Input.GetAxis("Horizontal")*-8.0f);
//		Debug.Log(rigidbody.velocity.magnitude);
//		rigidbody.rotation=rigidbody.rotation*Quaternion.Euler(0.0f,Input.GetAxis("Horizontal"),0.0f);

	}
	
}
